#ifndef wm_window_h
#define wm_window_h
/*
 * Sylvain BERTRAND <digital.ragnarok@gmail.com>
 * code protected by GNU GPL v3
 */
enum wm_window_class {
	WM_WINDOW_CLASS_CLIENT,
	WM_WINDOW_CLASS_INTERNAL
};
struct wm_window {
	enum wm_window_class type;
};
struct wm_internal_window {
	enum wm_window_class type;
	Window window;
};
#define WINDOW_IS_CLIENT(win) (((struct wm_window*)win)->type == WM_WINDOW_CLASS_CLIENT)
#define WINDOW_IS_INTERNAL(win) (((struct wm_window*)win)->type == WM_WINDOW_CLASS_INTERNAL)
#define WINDOW_AS_CLIENT(win) ((struct wm_client*)win)
#define WINDOW_AS_INTERNAL(win) ((struct wm_internal_window*)win)
#define CLIENT_AS_WINDOW(client) ((struct wm_window*)client)
#define INTERNAL_AS_WINDOW(intern) ((struct wm_window*)intern)
void window_startup(void);
void window_shutdown(void);
Window window_top(struct wm_window *self);
enum wm_stacking_layer window_layer(struct wm_window *self);
struct wm_window *window_find(Window xwin);
void window_add(Window *xwin, struct wm_window *win);
void window_remove(Window xwin);
void window_manage_all(void);
void window_manage(Window win);
void window_unmanage_all(void);
#endif
